package com.lx.controller;

import com.lx.serv.impl.UserServImpl;
import com.lx.utill.JwtUtill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping(value = "/consume")
public class UserConsumeController {
    //    private String password = "admin";
//    private String username = "admin";
    @Autowired
    private UserServImpl userServImpl;

    @GetMapping
    public Result getHotUser(@RequestHeader("token") String token) {
        if (!JwtUtill.VerifyToken(token)) {
            return new Result(Code.GET_FAIL, "获取失败", null);
        }
        return new Result(Code.GET_SUCCESS, "获取成功", userServImpl.getHot());
    }

}
